package com.basic.controller;


import com.area.entity.Producttype;
import com.area.service.IProducttypeService;
import com.code.domain.CommonResult;
import com.code.entity.User;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.ThreadContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

@ApiOperation(value = "商品分类",notes = "商品分类")
@Controller
@RequestMapping(value = "/basic/productType")
@Slf4j
@CrossOrigin
public class ProductTypeBasicController {

    @Autowired
    private IProducttypeService producttypeService;

    @ApiOperation(value = "查询所有商品分类信息",notes = "查询所有商品分类信息")
    @GetMapping(value = "/queryBasicProductTypeAll")
    public @ResponseBody CommonResult queryBasicProductTypeAll(Producttype producttype,
                                                               HttpServletRequest request,
                                                               HttpServletResponse response){

       List<Producttype> list = producttypeService.queryProductTypeAll(producttype);
        return new CommonResult(0,"操作成功",list.size(),list);
    }




}
